﻿using Prism.Commands;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zhy.PrismRegion.Journal.ViewModels
{
    public class MainWindowViewModel
    {
        /// <summary>
        /// 加载按钮
        /// </summary>
        public DelegateCommand BtnLoadCommand { get; set; }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="regionManager">区域子页面管理接口注入</param>
        public MainWindowViewModel(IRegionManager regionManager)
        {
            // 加载按钮
            BtnLoadCommand = new DelegateCommand(() =>
            {
                // 参数1：区域名称 参数2：子页面名称 参数3：要向子页面传递的参数
                regionManager.RequestNavigate("MainRegion", "ViewA");  // 显示子页面
            });


        }
    }
}
